from django.contrib import admin
from .models import Attachment
from ossfilefield.adminutils import show_link

class AttachmentAdmin(admin.ModelAdmin):
    # 加上showlink可以直接下载文件, 不加就只能看到字符串.
    list_display = ('title', 'owner', 'file', show_link('oss_file'))


admin.site.register(Attachment, AttachmentAdmin)